package com.aaa.controller.scl;

import com.aaa.entity.LayData;
import com.aaa.entity.MyPage;
import com.aaa.entity.scl.SclRecondTest;
import com.aaa.service.scl.SclRecondTestService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * (SclRecondTest)表控制层
 *
 * @author makejava
 * @since 2022-11-09 14:50:42
 */
@RestController
@RequestMapping("sclRecondTest")
public class SclRecondTestController {
    /**
     * 服务对象
     */
    @Autowired
    private SclRecondTestService sclRecondTestService;

    /**
     * 查询、条件查询
     * @param myPage
     * @param sclRecondTest
     * @return
     */
    @RequestMapping("querySclRecondTest")
    public LayData querySclRecondTest(MyPage myPage, SclRecondTest sclRecondTest) {
        PageInfo pageInfo = sclRecondTestService.querySclRecondTest(myPage, sclRecondTest);
        return new LayData(pageInfo);
    }

    /**
     * 添加
     * @param sclRecondTest
     * @return
     */
    @RequestMapping("addAndupd")
    public LayData addAndupd(SclRecondTest sclRecondTest, HttpSession session, HttpServletRequest request){
        boolean b = sclRecondTestService.addAndupd(sclRecondTest,session,request);
        return new LayData(b);
    }

    /**
     * 修改
     * @param sclRecondTest
     * @param session
     * @return
     */
    @RequestMapping("updSclRecondTest")
    public LayData updSclRecondTest(SclRecondTest sclRecondTest, HttpSession session){
        boolean b = sclRecondTestService.updSclRecondTest(sclRecondTest,session);
        return new LayData(b);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @RequestMapping("delSclRecondTest")
    public LayData delSclRecondTest(Integer id){
        boolean b = sclRecondTestService.delSclRecondTest(id);
        return new LayData(b);
    }

    @RequestMapping("delSclRecondTestbath")
    public LayData delSclRecondTestbath(Integer[] id){
        boolean b = sclRecondTestService.delSclRecondTestbath(id);
        return new LayData(b);
    }
}

